(function(){"use strict";BX.namespace("BX.Fileman.Google");BX.Fileman.Google.Map=function(t,o){this.node=t;this.param=o;this.googleMap=null;BX.Fileman.Google.Loader.init(BX.proxy(this.create,this))};BX.Fileman.Google.Map.prototype.create=function(){this.googleMap=new window.google.maps.Map(this.node,this.processParameters(this.param))};BX.Fileman.Google.Map.prototype.getGoogleMap=function(){return this.googleMap};BX.Fileman.Google.Map.prototype.processParameters=function(t){var o={noClear:true};if(!!t){if(!!t.center){o.center=BX.Fileman.Google.getGoogleLatLng(t.center)}if(!!t.zoom){o.zoom=t.zoom}}return o};BX.Fileman.Google.Map.prototype.addPoint=function(t){return new BX.Fileman.Google.Point(this,t)};BX.Fileman.Google.Map.prototype.panTo=function(t){BX.Fileman.Google.Loader.init(BX.delegate(function(){this.getGoogleMap().panTo(BX.Fileman.Google.getGoogleLatLng(t))},this))};BX.Fileman.Google.Point=function(t,o,e){this.map=t;this.latLng=o;this.googleLatLng=null;this.infoWindow=null;this.infoWindowContent=null;this.events={change:null,click:null};this.draggable=true;BX.Fileman.Google.Loader.init(BX.delegate(function(){this.googleLatLng=BX.Fileman.Google.getGoogleLatLng(o);var t={position:this.googleLatLng,map:this.map.getGoogleMap(),draggable:this.draggable};if(!!e){for(var n in e){if(e.hasOwnProperty(n)){t[n]=e[n]}}}this.marker=new google.maps.Marker(t);this.marker.addListener("click",BX.proxy(this.click,this));this.marker.addListener("dragend",BX.proxy(this.dragend,this))},this))};BX.Fileman.Google.Point.prototype.setEvent=function(t,o){this.events[t]=o};BX.Fileman.Google.Point.prototype.getMarker=function(){return this.marker};BX.Fileman.Google.Point.prototype.setDraggable=function(t){if(this.marker){this.marker.setDraggable(t)}this.draggable=t};BX.Fileman.Google.Point.prototype.setContent=function(t){BX.Fileman.Google.Loader.init(BX.defer(function(){this.setContent=this._setContent;this.setContent(t)},this))};BX.Fileman.Google.Point.prototype._setContent=function(t){if(this.infoWindow===null){this.infoWindowContent=BX.create("span",{children:[t]});this.infoWindow=new google.maps.InfoWindow({content:this.infoWindowContent,disableAutoPan:true})}else{setTimeout(function(){if(BX.type.isDomNode(t)){BX.cleanNode(this.infoWindowContent);this.infoWindowContent.appendChild(t)}else{BX.adjust(this.infoWindowContent,{text:t})}}.bind(this))}this.infoWindow.open({anchor:this.marker,map:this.map.getGoogleMap(),shouldFocus:false})};BX.Fileman.Google.Point.prototype.moveTo=function(t){this.latLng=t;BX.Fileman.Google.Loader.init(BX.delegate(function(){this.googleLatLng=BX.Fileman.Google.getGoogleLatLng(t);this.marker.setPosition(this.googleLatLng)},this))};BX.Fileman.Google.Point.prototype.click=function(t){if(!!this.events.click){this.events.click.apply(this,[this.latLng])}};BX.Fileman.Google.Point.prototype.dragend=function(t){this.googleLatLng=this.marker.getPosition();this.latLng=BX.Fileman.Google.getLatLng(this.googleLatLng);this.map.panTo(this.latLng);this.callChangeEvent()};BX.Fileman.Google.Point.prototype.callChangeEvent=function(){if(!!this.events.change){this.events.change.apply(this,[this.latLng])}BX.onCustomEvent(this,"onGoogleMapPointChanged",[this.index,this.latLng])};BX.Fileman.Google.Point.prototype.clean=function(){this.marker.setMap(null);this.marker=null};BX.Fileman.Google.Point.prototype.getPosition=function(){this.latLng=BX.Fileman.Google.getLatLng(this.googleLatLng);return this.latLng}})();
//# sourceMappingURL=map.map.js